<template>
	<view class="index">
		<scroll-view
			scroll-y="true"
			@scroll="scroll"
			class="scroll"
			:style="{ height: height + 'px' }"
			scroll-top="0"
		>
			<!-- 订单盒子 -->
			<view class="pl30 mt40 box" v-for="(item, index) in dataList" :key="index">
				<view>
					<subtitle :title="item.school"></subtitle>
					<view class="lines mt30"></view>
					<OrderItem v-for="(itm, idx) in item.orderArr" :key="idx" :data="itm"></OrderItem>
				</view>
			</view>
		</scroll-view>
		<tabbar :select="0"></tabbar>
	</view>
</template>

<script>
import tabbar from '@/components/tabbar/tabbar.vue';
import subtitle from '@/components/subtitle/subtitle.vue';
import OrderItem from '../components/OrderItem/OrderItem.vue';
import dataList from './order.js';
export default {
	components: {
		tabbar,
		subtitle,
		OrderItem
	},
	data() {
		return {
			sum: 0,
			dataList: dataList.dataList,
			height: ''
		};
	},
	methods: {
		scroll(e) {
			console.log(e);
		}
	},
	onShow() {
		var that = this;
		uni.getSystemInfo({
			success(res) {
				that.height = res.windowHeight - 54;
			}
		});
	},
	onLoad() {
		uni.setStorageSync('indexType',2)
	}
};
</script>

<style>
.lines {
	width: 710rpx;
	height: 28rpx;
	background: linear-gradient(90deg, #8092eb 0%, #4151db 100%);
	box-shadow: 0rpx 4rpx 4rpx 0rpx rgba(0, 0, 0, 0.25);
	border-radius: 20rpx 20rpx 20rpx 20rpx;
}
.item {
	width: 706rpx;
	height: 502rpx;
	background-image: url('../../pagesA/images/orderbg.png');
	background-repeat: no-repeat;
	background-size: 100% 100%;
	margin-bottom: 30rpx;
}
</style>
